package com.it.myd.controller;

import com.it.myd.bean.main.User;
import com.it.myd.service.mainService;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;

@Controller
public class mainController {

    @Autowired
    private mainService mser;

    @RequestMapping("goindex")
    public String goindex(HttpServletRequest request) {
        HttpSession session = request.getSession();
        ServletContext application = request.getServletContext();

        List<User> list = mser.getUserList();
        application.setAttribute("list",list);

        return "index";
    }

}
